#specify the minimum version of cmake
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)

#set PROJECT_NAME
PROJECT(iAP2)

#set target path
set(LIBRARY_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/build)
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/bin)

#CMAKE_CXX_FLAGS是编译选项
#set(SDKTARGETSYSROOT /home/user/T23MM_SDK/1/sysroots/aarch64-poky-linux)

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}  -std=c++0x")
# set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -s")
set( CMAKE_CXX_FLAGS_RELEASE	"${CMAKE_CXX_FLAGS_RELEASE} -s" )
set( CMAKE_BUILD_TYPE			"RELEASE" )

set( ENV{IPOD_ACCESSORY_CHIP_STR} /dev/i2c-17)
# set( ENV{IPOD_CACHE_FILE_PATH} /data/carplay/ipod)
set( ENV{IPOD_MEDIA_CONFIG_PATH} /app/carplay/ipodconfig.xml})

#add include path
#include_directories(${SDKTARGETSYSROOT}/usr/include/include/)

#libiAP2.so
include_directories(${CMAKE_SOURCE_DIR}/include
		    ${CMAKE_SOURCE_DIR}/include/util)

#enumrate the source file under src folder
#libiAP2.so
aux_source_directory(${CMAKE_SOURCE_DIR}/src/ LIB_IAP2_SRC)
aux_source_directory(${CMAKE_SOURCE_DIR}/src/util/ LIB_IAP2_SRC)

#add library target
#libiAP2.so
add_library(iAP2 SHARED ${LIB_IAP2_SRC})

#target created by ADD_XXX function.
target_link_libraries(iAP2)

#indicate the library path for the compiler
#INSTALL(TARGETS iAP2 LIBRARY DESTINATION "/rootfs_ext/usr/app/ipod")

